/*
 * Copyright 2011 Angel Sanadinov
 *
 * This file is part of VBox WMI.
 *
 * VBox WMI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VBox WMI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VBox WMI.  If not, see <http://www.gnu.org/licenses/>.
 */

package Utilities.Interfaces;

import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
 * Each class implementing this interface can be used to provide compression
 * for HTTP responses. <br><br>
 *
 * Implementing classes should be designed in such a way that they can be
 * fully constructed and initialized in the class constructor, and immediately
 * used to wrap the response object. The wrapped response will then be passed by
 * the calling filter to the next filter(s) in the chain.
 *
 * Any actions needed to be carried out after building the response and before it 
 * is passed to the client should be performed by the <code>commitResponse</code>
 * method.
 *
 * @see CompressionResponseWrapper#commitResponse()
 *
 * @author Angel Sanadinov
 */
public interface CompressionResponseWrapper extends HttpServletResponse
{
    /**
     * This method is to be implemented in such a way that it will be the last
     * method to be called before the response is committed and sent to the client.
     *
     * @throws IOException if an I/O error occurs
     */
    public void commitResponse() throws IOException;
}
